# Test runner.
import sys, os
pj = os.path.join

file_dir    = os.path.dirname(os.path.abspath(__file__))
base_dir     = os.path.dirname(file_dir)
deps_dir     = pj(base_dir, 'deps')
nose_dir     = pj(deps_dir, 'nose')
vpresent_dir   = pj(base_dir, 'vpresent')

print "Base:", base_dir
print "Deps:", deps_dir
print "Nose:", nose_dir
print "vPresent", vpresent_dir

sys.path.insert(0, nose_dir)
sys.path.insert(0, vpresent_dir)

import util

__build__   = 1
__version__ = "0.1.0.%d" % __build__
__date__    = ' '.join('$Date$'.split()[1:3])
__author__  = 'Priority 5 Holdings, Inc.'
__doc__     = '''This is vPresent. For more information, see the following:
   https://code.google.com/p/vpresent/'''

# Set constants right away.
const = util.const
const.APP_NAME     = 'vPresent'
const.EXEC_DIR     = os.path.abspath(pj(os.path.dirname(__file__), '..', 'vpresent'))
const.DATA_DIR     = pj(const.EXEC_DIR, '..', 'data')
const.SCHEMA_DIR   = const.DATA_DIR
const.VPRESENT_GUI = False
const.VERSION      = __version__

# Setup the loggers
import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.CRITICAL)

# Initialize OpenSG2
#import osg2 as osg
#osg.osgInit([])

import nose

result = nose.run()

print "Done"
sys.exit(0)

